package com.wgb.movie.mapper;

import com.wgb.movie.model.entity.HotMovie;
import com.wgb.movie.model.entity.MovieOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author wgb
* @description 针对表【movie_order(订单表)】的数据库操作Mapper
* @createDate 2024-08-23 16:49:22
* @Entity com.wgb.movie.model.entity.MovieOrder
*/
public interface MovieOrderMapper extends BaseMapper<MovieOrder> {
    @Select("select m.movieName, m.id, count(s.movieId) as showCount\n" +
            "from movie.movie_show s,\n" +
            "     movie.movie_order o,\n" +
            "     movie.movie m\n" +
            "where s.id = o.movieShowId\n" +
            "  and m.id = s.movieId\n" +
            "group by s.movieId limit 10")
    List<HotMovie> doHostMovieCount();
}




